package com.android.baseconfig.data.http.retrofit2.func;


import com.android.baseconfig.data.http.retrofit2.exception.ApiException;

import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.functions.Function;


/**
 * -----------------------------------------------------------------
 * Copyright (C) 2014-2016, by het, Shenzhen, All rights reserved.
 * -----------------------------------------------------------------
 * <p>
 * <p>描述：</p>
 * 名称:  <br>
 * 作者: uuxia<br>
 * 版本: 1.0<br>
 * 日期: 2016/9/27 19:03<br>
 **/
public class HttpResponseFunc<T> implements Function<Throwable, Observable<T>> {

    @Override
    public Observable<T> apply(Throwable t) throws Exception {
        return Observable.error(ApiException.handleException(t));
    }
}
